package com.dc.common.core;

import com.dc.common.utils.DateUtil;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * @author zhuangcy
 * @date 2021/6/15
 * @description 通用参数类
 */
@Data
public class BaseParamDto {

    @DateTimeFormat(pattern = DateUtil.YYYY_MM_DD_HH_MM_SS)
    @ApiModelProperty("开始时间")
    private Date startTime;

    @DateTimeFormat(pattern = DateUtil.YYYY_MM_DD_HH_MM_SS)
    @ApiModelProperty("结束时间")
    private Date endTime;

    @ApiModelProperty("请求参数")
    private Map<String, Object> params;

    public Map<String, Object> getParams() {
        if (params == null) {
            params = new HashMap<>();
        }
        return params;
    }
}
